1. Field of the Invention
The present invention relates to a video stream encoder and video stream encoding method, and a video stream multiplexer and video stream multiplexing method, and more particularly, to a video stream encoder and video stream encoding method, and a video stream multiplexer and video stream multiplexing method, capable of re-encoding, for edition of a video stream, the video stream without reference to information indicative of an initial status of a video buffer when re-encoding a part of the video stream.
2. Description of the Related Art
There is available the MPEG (Moving Picture coding Experts Group) standard as one of the techniques for encoding video streams representing a moving picture. The MPEG standard prescribes a virtual decoder model for connection to the output of an encoder. More specifically, to prevent any underflowing and overflowing of a buffer in the decoder model, to which an encoded video stream is supplied, the MPEG standard limits the buffer capacity anticipated when encoding the video stream. By thus limiting the occupancy by stored data of the buffer included in the decoder model, the MPEG defines a limitation imposed on the encoding of a video stream. The virtual decoder model is called xe2x80x9cVBV (Video Buffering Verifier)xe2x80x9d and the buffer in the virtual decoder is called xe2x80x9cVBV bufferxe2x80x9d.
For conformity with the requirements prescribed in the MPEG standard, a video stream should be encoded for neither underflowing nor overflowing of the VBV buffer. For example MP@ML (Main Profile at Main Level) of the MPEG-2 standard, the VBV buffer size is defined as 1.75 Mbits.
The encoder encodes a 16-bit field included in each picture and called xe2x80x9cinformation indicative of an initial status of a video bufferxe2x80x9d indicative of an initial status of the buffer at a random access. The information indicative of an initial status of a video buffer has a value representing a bit storage quantity (bit occupancy) the VBV buffer should have for decoding the picture. When decoding a picture, the virtual decoder reads a information indicative of an initial status of a video buffer appended to the picture, and then decodes the picture when the VBV buffer has a bit storage quantity represented by the information indicative of an initial status of a video buffer.
When editing two video streams encoded according to the MPEG standard to concatenate them with an accuracy of pictures, a few pictures before and after an edit point which is a concatenation between the two video streams are re-encoded in some cases. For a picture reproduction with a decoding of the edited video streams with no seam between them by the decoder, it is necessary that the video streams should have been edited and re-encoded for no overflowing and underflowing of the VBV buffer. To this end, an outpoint-side picture, in the edited video stream, positioned temporally before the edit point and an inpoint-side picture positioned temporally after the edit point are re-encoded as will be described below:
To re-encode an outpoint-side picture, the encoder first reads the information indicative of an initial status of a video buffer of a picture before a first picture to be re-encode. Next, the encoder uses the read information indicative of an initial status of a video buffer to calculate an initial bit storage quantity the VBV buffer should have for re-encoding the first picture to re-encoded by the VBV. Then, based on the computed initial bit storage quantity, the encoder re-encodes the pictures according to the VBV model.
Also, to re-encode an inpoint-side picture, the encoder first reads the information indicative of an initial status of a video buffer of a picture next to a last picture to re-encode. Next, the encoder uses the read information indicative of an initial status of a video buffer to calculate a bit storage quantity the VBV buffer should have for the last picture to re-encode by the VBV. Then, the encoder re-encodes the picture from the computed bit storage quantity according to the VBV model.
The MPEG-2 standard prescribes that it may optionally be selected whether or not information indicative of an initial status of a video buffer value should be encoded to be header information of a picture layer and included in a video stream. Therefore, in many cases, the above encoder encodes, into a value xe2x80x9c0xFFFFxe2x80x9d, the 16-bit information indicative of an initial status of a video buffer field included in header information of a picture layer of a video stream having been encoded in conformity to the MPEG-2 standard. Thus, when the information indicative of an initial status of a video buffer value is optionally encoded, it is not possible to calculate a correct bit storage quantity of the VBV buffer for an arbitrary picture. Therefore, with the above encoder, a bit storage quantity cannot be computed and a picture cannot be re-encoded from any bit storage quantity when editing video streams.
It is therefore an object of the present invention to overcome the above-mentioned drawbacks of the prior art by providing an encoding apparatus and method, and a multiplexing apparatus and method, adapted to re-encode a part of video streams in edition of them without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
The above object can be attained by providing an encoder including, according to the present invention:
means for re-encoding a first encoded stream ending with a first picture and a second stream concatenated to the end of the first picture and starting with a second picture;
a first means for calculating, for a video buffer in a virtual system target decoder model for decoding encoded streams re-encoded by the encoding means, a first bit storage quantity which should be when input of the first picture of the first encoded stream to the video buffer ends;
a second means for calculating, based on the first bit storage quantity calculated by the first bit storage quantity calculating means, a second bit storage quantity the video buffer in the virtual system target decoder model should have for starting decoding of the second picture of the second encoded stream according to the virtual system target model; and
means for controlling, based on the second bit storage quantity calculated by the second bit storage quantity calculating means, re-encoding of the second encoded stream, effected by the encoding means.
The above encoder further includes means for multiplexing, based on the first bit storage quantity, multiplexed streams including the second encoded stream re-encoded by the encoding controlling means.
The virtual system target decoder used in the above encoder conforms to the MPEG (Moving Picture coding Experts Group) standard.
Also the above object can be attained by providing an encoding method including, according to the present invention, steps of:
calculating, for a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams, a first bit storage quantity which should be when input of a first picture of a first encoded stream ending with the first picture to the video buffer ends;
calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer in the virtual system target decoder should have for starting, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the end of the first picture and beginning with the second picture; and
re-encoding the second encoded stream based on the second bit storage quantity.
The above encoding method further includes a step of re-multiplexing, based on the first bit storage quantity, multiplexed streams including the second encoded stream re-encoded by the encoding controlling means.
The virtual system target decoder used in the above encoding method conforms to the MPEG (Moving Picture coding Experts Group) standard.
With the above encoding apparatus and method, it is possible to re-encode a part of video streams without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
Also the above object can be attained by providing an encoder including according to the present invention:
means for re-encoding a first encoded stream beginning with a first picture and a second stream concatenated to the beginning of the first picture and ending with a second picture;
means for calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding encoded streams re-encoded by the encoding means should have for decoding the first picture of the first encoded stream;
means for calculating, based on the first bit storage quantity calculated by the first bit storage quantity calculating means, a second bit storage quantity the video buffer in the virtual system target decoder model should have for ending decoding of the second picture of the second encoded stream according to the virtual system target model; and
means for controlling, based on the second bit storage quantity calculated by the second bit storage quantity calculating means, re-encoding of the second encoded stream, effected by the encoding means
The virtual system target decoder used in the above encoder conforms to the MPEG (Moving Picture coding Experts Group) standard.
Also the above object can be attained by providing an encoding method including, according to the present invention, steps of:
calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams should have for decoding a first picture at the top of a first encoded stream;
calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer should have for ending, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the beginning of the first picture and ending with the second picture; and
re-encoding the second encoded stream based on the second bit storage quantity.
With the above encoding apparatus and method, it is possible to re-encode a part of video streams without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
Also the above object can be attained by providing a multiplexer including according to the present invention:
means for re-encoding a first encoded stream beginning with a first picture and a second stream concatenated to the beginning of the first picture and ending with a second picture;
means for calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding encoded streams re-encoded by the encoding means should have for decoding the first picture of the first encoded stream;
means for calculating, based on the first bit storage quantity calculated by the first bit storage quantity calculating means, a second bit storage quantity the video buffer in the virtual system target decoder model should have for decoding of the second picture of the second encoded stream according to the virtual system target model;
means for controlling, based on the second bit storage quantity calculated by the second bit storage quantity calculating means, re-encoding of the second encoded stream, effected by the encoding means;
a multiplexing means for generating a multiplexed stream including the second encoded stream using the second encoded stream re-encoded by the encoding means;
means for judging whether or not a third bit storage quantity the video buffer in the virtual system target decoder should have for concatenating the multiplexed stream re-multiplexed by the multiplexing means to a multiplexed stream including the first encoded stream presented after the re-multiplexed multiplexed stream from the multiplexing means, is within a predetermined range;
a multiplexing controlling means for controlling, based on the judgment result from the judging means, the time when the first picture of the multiplexed stream including the first encoded stream is to be supplied to the system target decoder model.
Also the above object can be attained by providing a multiplexing method including, according to the present invention, steps of:
calculating a first bit storage quantity a video buffer in a virtual system target decoder model for decoding re-encoded encoded streams should have for decoding a first picture at the top of a first encoded stream;
calculating, based on the first bit storage quantity, a second bit storage quantity the video buffer in the virtual system target decoder should have for ending, according to the virtual system target model, decoding of a second picture of a second encoded stream concatenated to the beginning of the first picture and ending with the second picture;
re-encoding the second encoded stream based on the second bit storage quantity;
generating a multiplexed stream including the second encoded stream using the re-encoded second encoded stream;
judging whether or not a third bit storage quantity the video buffer in the virtual system target decoder should have for concatenating the re-multiplexed multiplexed stream multiplexed to a multiplexed stream including the first encoded stream presented after the multiplexed stream, is within a predetermined range;
controlling, based on the judgment result, the time when the first picture of the multiplexed stream including the first encoded stream is to be supplied to the system target decoder model.
With the above multiplexing apparatus and method, it is possible to re-encode, for re-multiplexing, a part of video streams without the necessity of referencing to information indicative of an initial status of a video buffer included as a parameter of picture layer.
These objects and other objects, features and advantages of the present intention will become more apparent from the following detailed description of the preferred embodiments of the present invention when taken in conjunction with the accompanying drawings.